﻿<Window x:Class="SqlMiM.Views.OptionsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:controls="clr-namespace:SqlMiM.Common.Controls;assembly=SqlMiM.Common"
        xmlns:viewModel="clr-namespace:SqlMiM.ViewModel"
        xmlns:conv="clr-namespace:SqlMiM.Common.Converters;assembly=SqlMiM.Common"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Options" Height="450" Width="450" WindowStyle="None" 
        
    AllowsTransparency="True"
        SnapsToDevicePixels="True">
    <Window.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/SqlMiM.Common;Component/Resources/ControlsTheme.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <conv:DebugConverter x:Key="DebugConverter" />

            <DataTemplate x:Key="OptionTitle">
                <TextBlock Text="{Binding Name}" Margin="5,0,0,0" />
            </DataTemplate>


        </ResourceDictionary>
    </Window.Resources>
    <DockPanel LastChildFill="True" Background="{DynamicResource BrushDarkness}">

        <controls:TitleBarThumb IconSource="/SqlMiM.Common;component/Images/options.png"  DockPanel.Dock="Top" CanChangeWindowState="False" Title="Options" 
                                TitleMargin="30,0,0,0" />

        <Grid DockPanel.Dock="Bottom"  >
            <DockPanel LastChildFill="False">
                <Button Content="Cancel" Command="{Binding CancelCommand}" DockPanel.Dock="Right" Margin="5,5,10,5" Width="80" IsCancel="True" />
                <Button Content="Ok"  Command="{Binding CommitCommand}" DockPanel.Dock="Right" Margin="5,5,10,5" Width="80" IsDefault="True" />

            </DockPanel>
        </Grid>
        
        <Grid Margin="5" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <ContentControl Margin="5,-1,5,5" Grid.Row="1" >
                <ContentControl.Content>
                    <ListBox ItemsSource="{Binding OptionsPages}" ItemTemplate="{StaticResource OptionTitle}" SelectedItem="{Binding ActivePage, Mode=TwoWay}" >
                    </ListBox>
                </ContentControl.Content>
            </ContentControl>

            <ContentControl Margin="5,0,5,5" Grid.Column="1" Background="Black" Content="{Binding ActivePage.Content}"  />

        </Grid>


    </DockPanel>

</Window>
